<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>worker</title>
</head>
<body>

<script>
    if (!window.Worker) { 
        alert("Web Workers are not supported. Please upgrade your browser.");
    } 
    else{
        var worker = new Worker('task.js');

        worker.addEventListener('message', function (e) {
            alert('Worker said: ' + e.data.toString());
        }, false);

        worker.postMessage('Hello World');
    }
</script>

</body>
</html>